package cn.yanghan.client;


import cn.yanghan.dto.LoginUserDto;
import cn.yanghan.utils.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AuthServiceClientFallbackFactory implements FallbackFactory<AuthServiceClient> {


    @Override
    public AuthServiceClient create(Throwable throwable) {
        return new AuthServiceClient() {
            @Override
            public AjaxResult add(LoginUserDto loginUserDto) {
                return AjaxResult.me().setMessage("网络繁忙，请重试！");
            }
        };
    }
}